﻿

namespace OfficeClip.OpenSource.StyleFix
{
    using System;
    using System.Collections.Generic;
    using System.Text;

    /// <summary>
    /// Stylefix working object
    /// </summary>
    public class SFWorkingLine
    {
        public SFWorkingLine(decimal lineNo, string line, bool isRemove, List<SAObject> violations)
        {
            LineNo = lineNo;
            Line = line;
            IsRemove = isRemove;
            Violations = violations;
        }

        public decimal LineNo
        {
            get;
            set;
        }

        public string Line
        {
            get;
            set;
        }

        public bool IsRemove
        {
            get;
            set;
        }

        public int NestingLevel
        {
            get;
            set;
        }

        public List<SAObject> Violations
        {
            get;
            set;
        }

        public int TotalViolationsCount
        {
            get
            {
                return Violations.Count;
            }
        }

        public int TotalFixedViolationsCount
        {
            get
            {
                int count = 0;
                foreach (SAObject saObject in Violations)
                {
                    if (saObject.IsFixed)
                    {
                        count++;
                    }
                }

                return count;
            }
        }

        public void AddViolation(SAObject styleAccessObject)
        {
            Violations.Add(styleAccessObject);
        }

        public bool ClassRoot { get; set; }

        public bool NameSpaceRoot { get; set; }
    }
}
